<template>
  <div>
    <!-- 审批操作相关弹窗 -->
    <el-dialog title="查看审批" :visible.sync="showsp2" width="80%">
      <el-dialog title="驳回" :visible.sync="showsp3" appendToBody>
        <el-form ref="form" labelWidth="100px">
          <el-form-item label="驳回至">
            <el-radio v-model="backordernum" :label="item.val" v-for="(item, index) in refuseradio" :key="index"
              @change="changeselect" :disabled="splselect.length==0&&item.val==1"
            >
              {{item.label}}
              <el-select v-model="selectednumber" placeholder="请选择驳回人" v-if="item.val=='1'" :disabled="backordernum!='1'"
                clearable
              >
                <el-option v-for="item in splselect" :key="item.hash.ordernumber" :label="item.hash.username" :value="item.hash.ordernum"></el-option>
              </el-select>
            </el-radio>
          </el-form-item>
          <el-form-item label="驳回原因">
            <el-input v-model="reason"></el-input>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" @click="showsp3 = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="submitrefuse">确 定</el-button>
        </span>
      </el-dialog>
      <el-dialog title="委托" :visible.sync="showsp4" appendToBody width="40%">
        <el-form ref="form" labelWidth="100px">
          <el-form-item label="委托人">
            <el-select v-model="selectedwtr" placeholder="请选择委托人" clearable>
              <el-option v-for="item in helpList" :key="item.hash.pid" :label="item.hash.orgname+' '+item.hash.username" :value="item.hash.pid"></el-option>
            </el-select>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" @click="showsp4 = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="submitenstrust">确 定</el-button>
        </span>
      </el-dialog>
      <el-steps :active="active" simple>
        <el-step :title="item.hash.username+' ('+item.hash.statusname+')'" v-for="(item, index) in spData" :key="index" :status="statustype[item.hash.status]"></el-step>
      </el-steps>
      <el-divider></el-divider>
      <el-row :gutter="30">
        <el-col :span="16" style="min-height:150px">
          <leaveform v-if="isleaveform" :timename="'请假时间'" :checkdetail="checkdetail" :status="1"></leaveform>
          <repairform v-if="isrepairform" :status="1" :checkdetail="checkdetail"></repairform>
          <gooutform v-if="isgooutform" :status="1" :checkdetail="checkdetail"></gooutform>
          <moneyform v-if="ismoneyform" :status="1" :checkdetail="checkdetail"></moneyform>
          <carform v-if="iscarform" :status="1" :checkdetail="checkdetail"></carform>
          <reimform v-if="isreimform" :status="1" :checkdetail="checkdetail"></reimform>
          <contractform v-if="iscontractform" :status="1" :checkdetail="checkdetail"></contractform>
        </el-col>
        <el-col :span="8">
          <p style="padding:20px">
            审批记录：
            <b v-if="sptimeline.length==0">暂无记录</b>
          </p>
          <el-timeline style="height:auto;max-height:50vh;overflow:auto;padding-top:10px;" v-loading="timelineloding">
            <el-timeline-item v-for="(activity, index) in sptimeline" :key="index" :timestamp="activity.hash.intime">{{activity.hash.context}}</el-timeline-item>
          </el-timeline>
          <el-button v-if="isgooutform" size="small" type="primary" style="position: absolute;right:50px;bottom:23px;"
            @click="showshdata"
          >打印</el-button>
          <el-button v-if="isreimform" size="small" type="primary" style="position: absolute;right:50px;top:20px;"
            @click="showClick"
          >打印</el-button>
        </el-col>
      </el-row>

      <span slot="footer" class="dialog-footer">
        <!-- <el-button size="mini" v-if="isshowbtn2" type="danger" @click="withdraw">撤 回</el-button>
        <el-button size="mini" v-if="isshowbtn3" type="success" @click="resubmit">重新提交</el-button>-->
        <span v-if="isshowbtn" style="margin-left:10px">
          <el-button size="mini" @click="showsp4 = true" type="primary">委 托</el-button>
          <el-button size="mini" @click="refusesp" type="danger">驳 回</el-button>
          <el-button size="mini" @click="passsp" type="success">通 过</el-button>
        </span>
      </span>
    </el-dialog>
    <el-dialog title :visible.sync="innerVisible33" appendToBody width="95%"
      top="0" center
    >
      <el-row :gutter="40">
        <el-col :span="12">
          <el-button type="primary" size="small" style="margin-bottom:5px" @click="doprint">打印</el-button>
          <div id="printrecord">
            <div>
              <div style="height:50px;line-height:50px;font-size:20px;text-align:center;font-weight:600;color:#333">天津津贝尔试验工程试验检测技术有限公司</div>
              <div style="font-size:18px;text-align:center;font-weight:600;color:#333">外出会议，培训，学习，申报审批表</div>
              <p style="display:flex;justify-content:flex-end;margin-top:30px;margin-bottom:10px;">
                <span style="margin-right:90px;font-size:16px">时间:</span>
              </p>
              <div class="tablediv">
                <span style="border-bottom:0">申请部门</span>
                <span style="border-left:0;border-right:0;border-bottom:0;font-size:13px">{{thisdata.branchname}}</span>
                <span style="border-bottom:0">外出时间</span>
                <span style="border-left:0;border-bottom:0">{{thisdata.intime}}</span>
              </div>
              <div class="tablediv">
                <span style="width:25%;border-bottom:0">外出地点</span>
                <span style="width:75%;border-left:0;border-bottom:0">{{thisdata.address}}</span>
              </div>
              <div class="tablediv" style="position:relative">
                <span style="width:100%;padding:20px;height:100%;min-height:30vh;border-bottom:0">
                  <p style="height:40px;line-height:40px;text-align:left">外出事由及参加人员:</p>
                  <div>
                    <b style="margin-right:10px;">{{thisdata.detail}}</b>
                    <b>{{thisdata.userdetail}}</b>
                  </div>
                  <p style="position:absolute;bottom:10px;right:0;margin-right:50px;">
                    经办人:
                    <b>{{thisdata.username}}</b>
                  </p>
                </span>
              </div>
              <div style="display: flex;justify-content: space-around">
                <span class="tableSpan" style="border-right:0;">班主任签字:</span>
                <span class="tableSpan" style="border-right:0;">办公室主任签字:</span>
                <span class="tableSpan">经理签字:</span>
              </div>
              <div style="height:40px;line-height:40px;">
                <p style="margin-left:20px;font-size:13px;">备注:后附会议,培训或学习通知</p>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-dialog>

    <el-dialog title :visible.sync="innerVisible22" appendToBody width="95%"
      top="0" center
    >
      <el-row :gutter="40">
        <el-col :span="12">
          <el-button type="primary" size="small" style="margin-bottom:5px" @click="doprintTwo">打印</el-button>
          <div id="printrecordTwo">
            <div>
              <div style="height:50px;line-height:50px;font-size:20px;text-align:center;font-weight:600;color:#333">【天津津贝尔建筑工程试验检测技术有限公司】&nbsp;&nbsp;&nbsp;报销审批</div>
              <div style="display: grid;grid-template-columns: 30% 30% 30%;margin-left:60px;margin-bottom:20px;">
                <span style="">姓名:{{contentdatathree.username}}</span>
                <span style="">职位:{{contentdatathree.positional}}</span>
                <span style="">审批状态:审核通过</span>
              </div>
              <div style="display: grid;grid-template-columns: 30% 30% 30%;margin-left:60px;">
                <span style="">部门:{{contentdatathree.orgname}}</span>
                <span style>员工编号:{{contentdatathree.userid}}</span>
                <span style>提交时间:{{contentdatathree.intime}}</span>
              </div>
              <div class="tablediv top">
                <span class="topSpan" style="width:100%;height:100%;min-height:3vh;border-bottom:0">
                  <p style="text-align:left;margin-left:10px;">报销种类&nbsp;*&nbsp;(共计:{{contentdata.amountsum}})</p>
                </span>
              </div>
              <div v-for="(item,index) in contentdatatwo" :key="index">
                <div class="tablediv">
                  <span class="topSpan" style="width:100%;height:100%;min-height:3vh;border-bottom:0">
                    <p style="text-align:left;margin-left:10px;">
                      报销种类
                      <b style="font-weight:bold">({{index+1}})</b>
                    </p>
                  </span>
                </div>
                <div class="tablediv">
                  <span class="divSpan paddingleft" style="width:40%;height:100%;min-height:3vh;border-bottom:0;border-right:0;">
                    <b style="color:#000000;">报销种类</b>&nbsp;*&nbsp;{{item.hash.mounttypename}}--{{item.hash.childmounttypename}}
                  </span>
                  <span class="divSpan" style="width:45%;height:100%;min-height:3vh;border-bottom:0;border-right:0">
                    <b style="color:#000000;padding-left:10px;">用款部门</b>
                    {{item.hash.branchname}}
                  </span>
                  <span class="divSpan" style="width:15%;height:100%;min-height:3vh;border-bottom:0;">
                    <b style="color:#000000;">金额</b>
                    {{item.hash.amount}}
                  </span>
                </div>
              </div>
              <div class="tablediv">
                <span class="divSpan paddingleft" style="width:40%;height:100%;min-height:3vh;border-bottom:0;border-right:0;">
                  <b style="color:#000000;">报销内容</b>
                  &nbsp;&nbsp;{{contentdata.content}}
                </span>
                <span class="divSpan" style="width:60%;height:100%;min-height:3vh;border-bottom:0;">
                  <b style="color:#000000;padding-left:10px;">日期</b>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{contentdata.examinetime}}
                </span>
              </div>
              <div class="tablediv">
                <span class="divSpan" style="width:40%;height:100%;min-height:3vh;border-bottom:0;border-right:0;">
                  <b style="color:#000000;">支付方式</b>
                  &nbsp;&nbsp;&nbsp;&nbsp;{{contentdata.paytypename}}
                </span>
                <span class="divSpan" style="width:60%;height:100%;min-height:3vh;border-bottom:0">
                  <b style="color:#000000;padding-left:10px;">附件数量</b>
                  &nbsp;&nbsp;&nbsp;&nbsp;{{contentdata.filenumber}}
                </span>
              </div>
              <div class="tablediv">
                <span class="divSpan paddingleft" style="width:100%;height:100%;min-height:3vh;border-bottom:0;">
                  <b style="color:#000000;">大写金额</b>
                  &nbsp;&nbsp;{{contentdata.bigamountsum}}
                </span>
              </div>
              <div class="tablediv">
                <span class="divSpan paddingleft" style="width:100%;height:100%;min-height:3vh;border-bottom:0;">
                  <b style="color:#000000;">备注</b>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{contentdata.beizhu}}
                </span>
                
              </div>
              <div class="tablediv">
                <span class="updateSpan" style="width:15%;height:100%;min-height:100px;border-bottom:1px solid #000000;color:#000000;border-right:0;line-height:100%">
                  <p style="line-height:84px">单位负责人</p>
                </span>
                <span style="width:14%;height:100%;min-height:100px;border-bottom:1px solid #000000;border-right:0"></span>
                <span class="updateSpan" style="width:17%;height:100%;min-height:100px;border-bottom:1px solid #000000;color:#000000;border-right:0">
                  <p style="line-height:84px">部门负责人</p>
                </span>
                <span style="width:13%;height:100%;min-height:100px;border-bottom:1px solid #000000;border-right:0"></span>
                <span class="updateSpan" style="width:13%;height:100%;min-height:100px;border-bottom:1px solid #000000;color:#000000;border-right:0">
                  <p style="line-height:84px">验收人</p>
                </span>
                <span style="width:15%;height:100%;min-height:100px;border-bottom:1px solid #000000;border-right:0"></span>
                <span class="updateSpan" style="width:13%;height:100%;min-height:100px;border-bottom:1px solid #000000;color:#000000;border-right:0">
                  <p style="line-height:84px">经手人</p>
                </span>
                <span style="width:15%;height:100%;min-height:100px;border-bottom:1px solid #000000;"></span>
              </div>
              <div style="margin-top:15px;">
                <p style="font-size:16px;color:#000000;">审批记录</p>
              </div>
              <div class="tablediv" v-for="(item,index) in namedata" :key="index" style="diplay:flex;width:100%;justify-content:space-around;">
                <span class="remove">{{item.hash.intime}}</span>
                <span class="remove">{{item.hash.context}}</span>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
import leaveform from '~/components/sptype/leave.vue';
import repairform from '~/components/sptype/repair.vue';
import gooutform from '~/components/sptype/goout.vue';
import moneyform from '~/components/sptype/money.vue';
import carform from '~/components/sptype/car.vue';
import reimform from '~/components/sptype/reim.vue';
import contractform from '~/components/sptype/contract.vue';

export default {
  props: {
    nowapprovalid: {
      type: String,
      required: true,
    },
    checkitem: {
      type: Object,
      required: true,
    },
    fun: Function,
  },
  components: {
    leaveform,
    repairform,
    gooutform,
    moneyform,
    carform,
    reimform,
    contractform,
  },
  data() {
    return {
      isleaveform: false,
      isrepairform: false,
      isgooutform: false,
      ismoneyform: false,
      iscarform: false,
      isreimform: false,
      iscontractform: false,
      timelineloding: true,
      innerVisible33: false,
      innerVisible22: false,
      selectedwtr: '',
      backordernum: '',
      selectednumber: '',
      reason: '',
      radio: '',
      active: -1,
      selectedspl: '',
      thisdata: {},
      contentdata: {},
      contentdatatwo: [],
      contentdatathree: {},
      // nowapprovalid: '',
      bxmoney: '',
      showsp2: true,
      showsp: false,
      showsp3: false,
      showsp4: false,
      ts: this.newStore(),
      // splList: [],
      // splarr: [],
      spData: [],
      sptimeline: [],
      splselect: [],
      helpList: [],
      namedata: [],
      contentdatafour: {},
      statustype: {
        0: 'wait ',
        1: 'finish',
        2: 'success',
        3: 'error',
      },
      refuseradio: [
        {
          val: '0',
          label: '申请人',
        },
        {
          val: '-1',
          label: '上一级',
        },
        {
          val: '1',
          label: '',
        },
      ],
      isshowbtn: false,
      // isshowbtn2: false,
      // isshowbtn3: false,
      checkdetail: {},
    };
  },
  created() {
    if (this.checkitem.hash.atype == '0103') {
      this.getcheckdetail(
        'BD6A960AF46EE09F9C5B42D1658B3CCCA5A715B191607392',
        'isleaveform',
      );
    } else if (this.checkitem.hash.atype == '0106') {
      this.getcheckdetail(
        '9DEA590540016AF56AA8E4B54801438BB3F2193D08E31332D5E5601D2F82C2E672B5B64895E2F11C',
        'isrepairform',
      );
    } else if (this.checkitem.hash.atype == '0105') {
      this.getcheckdetail(
        '06BBA4638D6221E7C94D5152B4CB8D877A1F05FDC4A221F3FC134F422ABAA2D3DADB28EFE659DCF9',
        'isgooutform',
      );
    } else if (this.checkitem.hash.atype == '0102') {
      this.getcheckdetail(
        '40236578C287949E983CF935CC2173FE347A69929FDF7F2FE251F12C1C7E6A4B0FE3786F0F962D11',
        'ismoneyform',
      );
    } else if (this.checkitem.hash.atype == '0104') {
      this.getcheckdetail(
        '27C5BBCC57742906E0FD67DAD8D2622896D1E3093AF33DA156AD69D48355AA75947C61655EDF54FA',
        'iscarform',
      );
    } else if (this.checkitem.hash.atype == '0101') {
      this.getcheckdetail(
        '0398B14C0EC6F01867D31307B7D9BCF99F9190F74AA3A4C7C5EECFEA4B2A82E4BFF0B9210751F692',
        'isreimform',
      );
    } else if (this.checkitem.hash.atype == '0107') {
      this.getcheckdetail(
        '09D3B9E20F101E11CD5ED14F3DA05EF7E5F8A7980C727D360C5596A61637D2F6FC5D937ABF463C840FE3786F0F962D11',
        'iscontractform',
      );
    }
    this.gethelpList();
    this.getspData();
  },
  methods: {
    getcheckdetail(handle, atypename) {
      const req = {
        handle,
        aid: this.checkitem.hash.id,
      };
      this.spost(this.ts, '/mainservlet', req).then((ts) => {
        this.checkdetail = ts.d.data;
        this.reload(atypename);
      });
    },
    getsplid() {
      const req = {
        handle: 'BD6A960AF46EE09F9C5B42D1658B3CCCA5A715B191607392',
        approvalid: this.nowapprovalid,
      };
      this.spost(this.ts, '/mainservlet', req).then((ts) => {
        console.log(ts.d.data, '2132');
      });
    },
    // 提交委托
    submitenstrust() {
      const res = {
        handle:
          '9000B8B8D347526960C5BAB1FB6894EF8840DAE4ED8972731A7CCEED1C488A21BFF0B9210751F692',
        approvalid: this.nowapprovalid,
        enstrustuser: this.selectedwtr,
      };
      this.$confirm('确定提交委托, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(() => {
          this.spost(this.ts, '/mainservlet', res).then((ts) => {
            if (ts.d.data.operation1[0].hash.msg == 'success') {
              this.getspData();

              this.$message({
                type: 'success',
                message: '提交成功!',
              });
              this.showsp4 = false;
            } else {
              this.$message({
                type: 'error',
                message: ts.d.data.operation1[0].hash.msg,
              });
            }
          });
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消',
          });
        });
    },
    // 获取委托人列表
    gethelpList() {
      this.helpList = [];
      const req = {
        handle:
          '45EE8FEFE87870C53A0536D8566DA8C94345851CDDF60960CBCA139672EA5B8C230BE336D992C9E341DC33B3A5E90841',
        query: '',
      };
      this.spost(this.ts, '/mainservlet', req).then((ts) => {
        this.helpList = ts.d.data.operation1;
      });
    },
    // 提交驳回
    submitrefuse() {
      let res;
      if (this.backordernum == '1') {
        res = {
          handle:
            '9000B8B8D347526960C5BAB1FB6894EF8840DAE4ED8972735532B597DC457CE9',
          approvalid: this.nowapprovalid,
          backordernum: this.selectednumber,
          reason: this.reason,
        };
      } else {
        res = {
          handle:
            '9000B8B8D347526960C5BAB1FB6894EF8840DAE4ED8972735532B597DC457CE9',
          approvalid: this.nowapprovalid,
          backordernum: this.backordernum,
          reason: this.reason,
        };
      }
      this.$confirm('确定提交审批驳回, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(() => {
          this.spost(this.ts, '/mainservlet', res).then((ts) => {
            if (ts.d.data.operation1[0].hash.msg == 'success') {
              this.getspData();

              this.$message({
                type: 'success',
                message: '提交成功!',
              });
              this.showsp3 = false;
              this.fun();
            } else {
              this.$message({
                type: 'error',
                message: ts.d.data.operation1[0].hash.msg,
              });
            }
          });
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消',
          });
        });
    },
    // 驳回时判断是否选择指定层级的人
    changeselect(val) {
      if (val != '1') {
        this.selectednumber = '';
      }
    },
    // 通过审批
    passsp() {
      const req = {
        handle:
          '9000B8B8D347526960C5BAB1FB6894EF8840DAE4ED897273FB8FE1B9930A2314',
        approvalid: this.nowapprovalid,
      };
      this.$confirm('确定提交审批通过, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(() => {
          this.spost(this.ts, '/mainservlet', req).then((ts) => {
            if (ts.d.data.operation1[0].hash.msg == 'success') {
              this.getspData();
              this.$message({
                type: 'success',
                message: '提交成功!',
              });
              this.fun();
            } else {
              this.$message({
                type: 'error',
                message: ts.d.data.operation1[0].hash.msg,
              });
            }
          });
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消',
          });
        });
    },
    // 公共组件刷新
    reload(partsname) {
      // console.log(partsname);
      this[partsname] = false;
      this.$nextTick(() => {
        this[partsname] = true;
      });
    },
    // 驳回审批
    refusesp() {
      // console.log(this.showsp3);
      this.$nextTick(() => {
        this.showsp3 = true;
      });
    },
    // 获取单条审批记录
    getspData() {
      const req = {
        handle:
          '9000B8B8D347526960C5BAB1FB6894EF5DDF49381938997FB935EBAD26A0911CBFF0B9210751F692',
        approvalid: this.nowapprovalid,
      };
      const req2 = {
        handle:
          '9000B8B8D347526960C5BAB1FB6894EF5DDF49381938997FFE9CFC209D07C85490D67199A7471506',
        approvalid: this.nowapprovalid,
      };
      const req3 = {
        handle:
          '9000B8B8D347526960C5BAB1FB6894EF8F3C0B2702AA820C227FEB5A2E535EB8ACEF8AE5E24D532D',
        approvalid: this.nowapprovalid,
      };
      this.spost(this.ts, '/mainservlet', req3).then((ts3) => {
        this.splselect = ts3.d.data.operation1;
      });
      this.spost(this.ts, '/mainservlet', req2).then((ts2) => {
        this.sptimeline = ts2.d.data.operation1;
        this.timelineloding = false;
      });
      this.spost(this.ts, '/mainservlet', req).then((ts) => {
        this.active = -1;
        this.isshowbtn = false;
        // this.isshowbtn2 = false;
        // this.isshowbtn3 = false;
        this.spData = ts.d.data.operation1;
        this.active = this.spData.length;
        const a = ts.d.data.operation2;
        // const b = ts.d.data.operation3;
        // const c = ts.d.data.operation4;
        if (
          a.length > 0 &&
          a[0].hash.approval_user == localStorage.getItem('pid')
        ) {
          this.isshowbtn = true;
        }
        // if ((b[0].hash.createuser == localStorage.getItem('pid')) && c[0].hash.status == '1') {
        //   this.isshowbtn2 = true;
        // }
        // if ((b[0].hash.createuser == localStorage.getItem('pid')) && (c[0].hash.status == '-1' || c[0].hash.status == '0')) {
        //   this.isshowbtn3 = true;
        // }
        // alert(this.active);
        // this.showsp2 = true;
      });
    },
    // 打印功能
    showshdata() {
      const req = {
        handle:
          '06BBA4638D6221E7C94D5152B4CB8D877A1F05FDC4A221F3FC134F422ABAA2D3DADB28EFE659DCF9',
        aid: localStorage.getItem('id'),
      };
      this.spost(this.ts, '/mainservlet', req).then((ts) => {
        if (ts.d.sflag == 'success') {
          this.thisdata = ts.d.data.operation1[0].hash;
          console.log(ts.d.data.operation1);
        }
      });
      console.log(req);
      this.innerVisible33 = true;
    },
    // 报销审批
    showClick() {
      // 内容数据
      const req = {
        handle:
          '0398B14C0EC6F01867D31307B7D9BCF99F9190F74AA3A4C7C5EECFEA4B2A82E4BFF0B9210751F692',
        aid: localStorage.getItem('id'),
      };
      // 处理人数据
      const req2 = {
        handle:
          '9000B8B8D347526960C5BAB1FB6894EF5DDF49381938997FFE9CFC209D07C85490D67199A7471506',
        approvalid: localStorage.getItem('id'),
      };
      // 提交
      const req3 = {
        handle:
          '9000B8B8D347526960C5BAB1FB6894EF5DDF49381938997FB935EBAD26A0911CBFF0B9210751F692',
        approvalid: localStorage.getItem('id'),
      };
      this.spost(this.ts, '/mainservlet', req).then((ts) => {
        if (ts.d.sflag == 'success') {
          this.contentdata = ts.d.data.operation1[0].hash;
          this.contentdatatwo = ts.d.data.operation2;
          console.log(this.contentdata);
          console.log(this.contentdatatwo);
        }
      });
      this.spost(this.ts, '/mainservlet', req2).then((ts) => {
        if (ts.d.sflag == 'success') {
          this.namedata = ts.d.data.operation1;
          console.log(this.namedata);
        }
      });
      this.spost(this.ts, '/mainservlet', req3).then((ts) => {
        if (ts.d.sflag == 'success') {
          this.contentdatathree = ts.d.data.operation3[0].hash;
          this.contentdatafour = ts.d.data.operation1[0].hash;
          console.log(this.contentdatathree);
          console.log(this.contentdatafour);
          this.innerVisible22 = true;
        }
      });
      
    },
    // 打印
    doprint() {
      this.$nextTick(() => {
        const detailContent = document.getElementById('printrecord');
        Print('#printrecord');
      });
    },
    doprintTwo() {
      this.$nextTick(() => {
        const detailContent = document.getElementById('printrecordTwo');
        Print('#printrecordTwo');
      });
    },
  },
};
</script>

<style scoped>
.el-form-item {
  width: 50%;
  margin-bottom: 22px;
  display: inline-block;
}
.tablediv {
  display: flex;
  justify-content: space-around;
}
.tablediv span {
  border: 1px solid #333;
  display: inline-block;
  width: 25%;
  height: 50px;
  line-height: 50px;
  text-align: center;
}
.tableSpan {
  border: 1px solid #333;
  display: inline-block;
  width: 33.3%;
  height: 130px;
  line-height: 70px;
  text-align: left;
  padding-left: 10px;
}
.top {
  margin-top: 20px;
}
.topSpan {
  height: 30px !important;
  line-height: 30px !important;
  color: #000000 !important;
}
.divSpan {
  height: 30px !important;
  line-height: 30px !important;
  text-align: left !important;
}
.updateSpan {
  line-height: 22px !important;
  padding-top: 7px;
}
.paddingleft {
  padding-left: 0 !important;
}
.remove {
  border: 0 !important;
  display: inline-block !important;
  width: 30% !important;
  height: 30px !important;
  line-height: 20px !important;
  text-align: center !important;
}
</style>
